package chapter15;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by lzy
 * Date: 2018/5/12
 */
public class ClassCasting {
    @SuppressWarnings("unchecked")
    public static void main(String[] args) {
        String[] arrays = {"a","b","c"};
        List<String> list = new ArrayList<>(Arrays.asList(arrays));
        Object obj = list;
        List<String> temp = (List<String>) list;
        System.out.println(list.get(0));
        List<String> convert = List.class.cast(obj);
        convert.forEach(System.out::println);
    }
}
